package com.ruoyi.ring.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ring.domain.RingGroupMessage;
import com.ruoyi.ring.mapper.RingGroupMessageMapper;
import com.ruoyi.ring.service.IRingGroupMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 群组信息Service业务层处理
 * 
 * @author liuwp
 * @date 2025-10-20
 */
@Service
public class RingGroupMessageServiceImpl implements IRingGroupMessageService 
{
    @Resource
    private RingGroupMessageMapper ringGroupMessageMapper;

    /**
     * 查询群组信息
     * 
     * @param id 群组信息主键
     * @return 群组信息
     */
    @Override
    public RingGroupMessage selectRingGroupMessageById(Long id)
    {
        return ringGroupMessageMapper.selectRingGroupMessageById(id);
    }

    /**
     * 查询群组信息列表
     * 
     * @param ringGroupMessage 群组信息
     * @return 群组信息
     */
    @Override
    public List<RingGroupMessage> selectRingGroupMessageList(RingGroupMessage ringGroupMessage)
    {
        return ringGroupMessageMapper.selectRingGroupMessageList(ringGroupMessage);
    }

    /**
     * 根据业务主键查询一条记录：群组信息
     *
     * @param ringGroupMessage 群组信息
     * @return 群组信息
     */
    @Override
    public RingGroupMessage selectOneRingGroupMessage(RingGroupMessage ringGroupMessage)
    {
        return ringGroupMessageMapper.selectOneRingGroupMessage(ringGroupMessage);
    }

    /**
     * 新增群组信息
     * 
     * @param ringGroupMessage 群组信息
     * @return 结果
     */
    @Override
    public int insertRingGroupMessage(RingGroupMessage ringGroupMessage)
    {
        ringGroupMessage.setCreateTime(DateUtils.getNowDate());
        return ringGroupMessageMapper.insertRingGroupMessage(ringGroupMessage);
    }

    /**
     * 修改群组信息
     * 
     * @param ringGroupMessage 群组信息
     * @return 结果
     */
    @Override
    public int updateRingGroupMessage(RingGroupMessage ringGroupMessage)
    {
        ringGroupMessage.setUpdateTime(DateUtils.getNowDate());
        return ringGroupMessageMapper.updateRingGroupMessage(ringGroupMessage);
    }

    @Override
    public int updateRingGroupMessageCondition(RingGroupMessage ringGroupMessage, RingGroupMessage ringGroupMessageCondition)
    {
                ringGroupMessage.setUpdateTime(DateUtils.getNowDate());
        return ringGroupMessageMapper.updateRingGroupMessageCondition(ringGroupMessage, ringGroupMessageCondition);
    }

    /**
     * 批量删除群组信息
     * 
     * @param ids 需要删除的群组信息主键
     * @return 结果
     */
    @Override
    public int deleteRingGroupMessageByIds(Long[] ids)
    {
        return ringGroupMessageMapper.deleteRingGroupMessageByIds(ids);
    }

    /**
     * 删除群组信息信息
     * 
     * @param id 群组信息主键
     * @return 结果
     */
    @Override
    public int deleteRingGroupMessageById(Long id)
    {
        return ringGroupMessageMapper.deleteRingGroupMessageById(id);
    }

    /**
     * 条件删除群组信息
     *
     * @param ringGroupMessage 群组信息
     * @return 结果
     */
    @Override
    public int deleteRingGroupMessageByCondition(RingGroupMessage ringGroupMessage)
    {
        return ringGroupMessageMapper.deleteRingGroupMessageByCondition(ringGroupMessage);
    }

}
